*Replication code part 1 for "In Government We Trust: Implicit Political Trust and Regime Support in China" by Haifeng Huang, Chanita Intawan, and Stephen Nicholson, Perspectives on Politics

*Prepared in February 2022



/***** Variables

diatgov = IAT D-scores 
diatgov_scaled = IAT D-scores rescaled to range from 0 to 1
trust_index = explicit trust, ranging from 0 to 100
trustindex_scaled = trust_index rescaled to range from 0 to 1
female = 0 or 1
agegroup = age group, ranging from 1 to 10
agegroup_scaled = agegroup rescaled to range from 0 to 1
education = education level, ranging from 1 (primary school or below) to 6 (graduate school)
education_scaled = education rescaled to range from 0 to 1
urban = urban residency (0 or 1)
income = income status, ranging from 1 to 9
income_scaled = income rescaled to range from 0 to 1
ccpmember = membership in the Chinese Communist Party (0 or 1)
confucian_index = Confucian values, ranging from 1 to 4
confucian_scaled = confucian_index rescaled to range from 0 to 1
china = evaluation of China's current situation, ranging from 1 to 5
china_scaled = evaluation of china rescaled to range from 0 to 1
self_index = self-monitoring, ranging from 1 to 5
self_scaled = self-monitoring rescaled to range from 0 to 1
system_index = system justification, ranging from 1 to 9
system_index_rnd = system justification rounded to whole numbers
system_index_scaled = system_index rescaled to range from 0 to 1
socialcredit = support for the social credit system, ranging from 1 to 5
socialcredit_scaled = socialcredit rescaled to range from 0 to 1
govsurveillance = concerned about government surveillance, ranging from 1 to 4
govsurveillance_scaled = govsurveillance rescaled to range from 0 to 1
tradewar = trust in government during a trade war, ranging from 1 to 7
tradewar_sacled = tradewar rescaled to range from 0 to 1
disaster = trust in government during a natural disaster, ranging from 1 to 7
disaster_scaled = disaster rescaled to range from 0 to 1
foreignattack = trust in government during a foreign attack, ranging from 1 to 7
foreignattack_scaled = foreignattack rescaled to range from 0 to 1
life = life satisfication, ranging from 1 to 5
life_scaled = life rescaled to range from 0 to 1
pinterest = political interest, ranging from 1 to 4
pinterest_scaled = pinterest rescaled to range from 0 to 1
young40 = a dummy variable coded 1 if agegroup < 6 (age < 40) and coded 0 otherwise

*****/




clear
use IAT_China_replication_data.dta

*******************************
******     Main Text     ******
*******************************



****** Figures 2-4: See Replication Part 2 ******



****** Figure 5 ******

eststo d1: quietly regress diatgov_scaled  female agegroup_scaled education_scaled  urban income_scaled ccpmember 

eststo d2: quietly regress diatgov_scaled  female agegroup_scaled education_scaled  urban income_scaled ccpmember  confucian_scaled  china_scaled self_scaled

eststo d3: quietly regress trustindex_scaled  female agegroup_scaled education_scaled  urban income_scaled ccpmember  

eststo d4: quietly regress trustindex_scaled  female agegroup_scaled education_scaled  urban income_scaled ccpmember confucian_scaled  china_scaled self_scaled

coefplot (d1, label(Demographics Only) msymbol(T)) (d2, label(Full Model) msymbol(O)), bylabel(Implicit Trust)||  (d3) (d4), bylabel(Explicit Trust) ||, ///
drop(_cons) xline(0, lpattern(dash) lcolor(black) lwidth(thin)) byopts(compact  graphregion(fcolor(white))) ///

eststo clear



*** margins associated with Figure 5***

regress diatgov_scaled  i.female agegroup_scaled education_scaled  i.urban income_scaled i.ccpmember  confucian_index china_scaled self_index

margins, at(education_scaled=(0,1)) 

regress trustindex_scaled  i.female agegroup_scaled education_scaled  i.urban income_scaled i.ccpmember  confucian_index  china self_index

margins, at(education_scaled=(0,1)) 


regress diatgov_scaled  i.female agegroup_scaled education_scaled  i.urban income_scaled i.ccpmember  confucian_index china self_index

margins, at(urban=(0,1)) 

regress trustindex_scaled  i.female agegroup_scaled education_scaled  i.urban income_scaled i.ccpmember  confucian_index  china self_index

margins, at(urban=(0,1)) 


regress trustindex_scaled  i.female agegroup_scaled education_scaled  i.urban income_scaled i.ccpmember  confucian_index  china_scaled self_scaled

margins, at(china_scaled=(0,1)) 


regress trustindex_scaled  i.female agegroup_scaled education_scaled  i.urban income_scaled i.ccpmember  confucian_index  china_scaled self_scaled

margins, at(self_scaled=(0,1)) 


regress trustindex_scaled  i.female agegroup_scaled education_scaled  i.urban income_scaled i.ccpmember  confucian_index  china_scaled self_scaled

margins, at(income_scaled=(0,1)) 



****** Figure 6 ******

grstyle init
grstyle set plain
grstyle color background white
grstyle clockdir legend_position 12
grstyle linestyle legend none


reg system_index_scaled diatgov_scaled trustindex_scaled i.female agegroup_scaled education_scaled i.urban income_scaled i.ccpmember life_scaled pinterest_scaled

margins, at(diatgov_scaled=(0(0.01)1)) 
marginsplot, ytitle(System Justification) xtitle(Implicit Trust)  title(Predictive Margins with 95% CIs, color(black)) graphregion(fcolor(none)) recast(line) recastci(rarea) plotopts(msymbol(none) lcolor(black)) ciopts(pstyle(ci)) ylabel(0[.2]1)

graph save margins_systemjustification.gph, replace
***

reg socialcredit_scaled diatgov_scaled trustindex_scaled i.female agegroup_scaled education_scaled i.urban income_scaled i.ccpmember life_scaled pinterest_scaled

margins, at(diatgov_scaled=(0(0.01)1))  
marginsplot, ytitle(Social Credit System) xtitle(Implicit Trust) title(Predictive Margins with 95% CIs, color(black)) graphregion(fcolor(none)) recast(line) recastci(rarea) plotopts(msymbol(none) lcolor(black)) ciopts(pstyle(ci)) ylabel(0[.2]1)

graph save margins_socialcredit.gph, replace

***

reg govsurveillance_scaled diatgov_scaled trustindex_scaled i.female agegroup_scaled education_scaled i.urban income_scaled i.ccpmember life_scaled pinterest_scaled

margins, at(diatgov_scaled=(0(0.01)1))  
marginsplot, ytitle(Government Surveillance) xtitle(Implicit Trust) title(Predictive Margins with 95% CIs, color(black)) graphregion(fcolor(none)) recast(line) recastci(rarea) plotopts(msymbol(none) lcolor(black)) ciopts(pstyle(ci)) ylabel(0[.2]1)

graph save margins_surveillance.gph, replace

***

graph combine margins_systemjustification.gph margins_socialcredit.gph margins_surveillance.gph, rows(1) xsize(10) ysize(6)

graph save margins_combine_system.gph, replace

grstyle clear



****** Figure 7 ******

grstyle init
grstyle set plain
grstyle color background white
grstyle clockdir legend_position 12
grstyle linestyle legend none


reg tradewar_scaled diatgov_scaled trustindex_scaled i.female agegroup_scaled education_scaled i.urban income_scaled i.ccpmember life_scaled pinterest_scaled

margins, at(diatgov_scaled=(0(0.01)1))  
marginsplot, ytitle(Trade War) xtitle(Implicit Trust) title(Predictive Margins with 95% CIs, color(black)) graphregion(fcolor(none)) recast(line) recastci(rarea) plotopts(msymbol(none) lcolor(black)) ciopts(pstyle(ci)) ylabel(0[.2]1)

graph save margins_tradewar.gph, replace

***

reg disaster_scaled diatgov_scaled trustindex_scaled i.female agegroup_scaled education_scaled i.urban income_scaled i.ccpmember life_scaled pinterest_scaled

margins, at(diatgov_scaled=(0(0.01)1))  
marginsplot, ytitle(Disaster) xtitle(Implicit Trust) title(Predictive Margins with 95% CIs, color(black)) graphregion(fcolor(none)) recast(line) recastci(rarea) plotopts(msymbol(none) lcolor(black)) ciopts(pstyle(ci)) ylabel(0[.2]1)

graph save margins_disaster.gph, replace

***

reg foreignattack_scaled diatgov_scaled trustindex_scaled i.female agegroup_scaled education_scaled i.urban income_scaled i.ccpmember life_scaled pinterest_scaled

margins, at(diatgov_scaled=(0(0.01)1))  
marginsplot, ytitle(Foreign Attack) xtitle(Implicit Trust) title(Predictive Margins with 95% CIs, color(black)) graphregion(fcolor(none)) recast(line) recastci(rarea) plotopts(msymbol(none) lcolor(black)) ciopts(pstyle(ci)) ylabel(0[.2]1)

graph save margins_foreignattack.gph, replace

***

graph combine margins_tradewar.gph margins_disaster.gph margins_foreignattack.gph,  rows(1) xsize(10) ysize(6)

graph save margins_combine_crises.gph, replace

grstyle clear





*******************************
******      Appendix     ******
*******************************


****** Table D1 ******

regress diatgov_scaled  female agegroup_scaled education_scaled  urban income_scaled ccpmember 

regress diatgov_scaled  female agegroup_scaled education_scaled  urban income_scaled ccpmember  confucian_scaled  china_scaled self_scaled

regress trustindex_scaled  female agegroup_scaled education_scaled  urban income_scaled ccpmember   

regress trustindex_scaled  female agegroup_scaled education_scaled  urban income_scaled ccpmember confucian_scaled  china_scaled self_scaled



****** Table D2 ******

pwcorr female agegroup education urban income ccpmember confucian_index china self_index



****** Table D3 ******

regress diatgov_scaled  female i.young40##c.education_scaled  urban income_scaled ccpmember 

regress diatgov_scaled  female i.young40##c.education_scaled  urban income_scaled ccpmember  confucian_scaled  china_scaled self_scaled

regress trustindex_scaled  female i.young40##c.education_scaled urban income_scaled ccpmember   

regress trustindex_scaled  female i.young40##c.education_scaled  urban income_scaled ccpmember confucian_scaled  china_scaled self_scaled



****** Table D4 ******

regress diatgov_scaled  female ib(6).agegroup##c.education_scaled  urban income_scaled ccpmember 

regress diatgov_scaled  female ib(6).agegroup##c.education_scaled  urban income_scaled ccpmember  confucian_scaled  china_scaled self_scaled

regress trustindex_scaled  female ib(6).agegroup##c.education_scaled urban income_scaled ccpmember   

regress trustindex_scaled  female ib(6).agegroup##c.education_scaled  urban income_scaled ccpmember confucian_scaled  china_scaled self_scaled



****** Table D5 ******

reg system_index_scaled diatgov_scaled trustindex_scaled female agegroup_scaled education_scaled urban income_scaled ccpmember life_scaled pinterest_scaled

reg system_index_scaled diatgov_scaled  female agegroup_scaled education_scaled urban income_scaled ccpmember life_scaled pinterest_scaled

reg socialcredit_scaled diatgov_scaled trustindex_scaled female agegroup_scaled education_scaled urban income_scaled ccpmember life_scaled pinterest_scaled

reg socialcredit_scaled diatgov_scaled  female agegroup_scaled education_scaled urban income_scaled ccpmember life_scaled pinterest_scaled

reg govsurveillance_scaled diatgov_scaled trustindex_scaled female agegroup_scaled education_scaled urban income_scaled ccpmember life_scaled pinterest_scaled

reg govsurveillance_scaled diatgov_scaled  female agegroup_scaled education_scaled urban income_scaled ccpmember life_scaled pinterest_scaled



****** Table D6 ******

oprobit system_index_rnd  diatgov_scaled trustindex_scaled female agegroup education ccpmember income urban life pinterest

oprobit system_index_rnd  diatgov_scaled  female agegroup education ccpmember income urban life pinterest

oprobit socialcredit  diatgov_scaled trustindex_scaled female agegroup education ccpmember income urban life pinterest

oprobit socialcredit  diatgov_scaled  female agegroup education ccpmember income urban life pinterest

oprobit govsurveillance  diatgov_scaled trustindex_scaled female agegroup education ccpmember income urban life pinterest

oprobit govsurveillance  diatgov_scaled  female agegroup education ccpmember income urban life pinterest



****** Table D7 ******

reg tradewar_scaled diatgov_scaled trustindex_scaled female agegroup_scaled education_scaled urban income_scaled ccpmember life_scaled pinterest_scaled

reg tradewar_scaled diatgov_scaled  female agegroup_scaled education_scaled urban income_scaled ccpmember life_scaled pinterest_scaled

reg disaster_scaled diatgov_scaled trustindex_scaled female agegroup_scaled education_scaled urban income_scaled ccpmember life_scaled pinterest_scaled

reg disaster_scaled diatgov_scaled  female agegroup_scaled education_scaled urban income_scaled ccpmember life_scaled pinterest_scaled

reg foreignattack_scaled diatgov_scaled trustindex_scaled female agegroup_scaled education_scaled urban income_scaled ccpmember life_scaled pinterest_scaled

reg foreignattack_scaled diatgov_scaled  female agegroup_scaled education_scaled urban income_scaled ccpmember life_scaled pinterest_scaled



****** Table D8 ******

oprobit tradewar diatgov_scaled trustindex_scaled female agegroup education ccpmember income urban life pinterest

oprobit tradewar diatgov_scaled  female agegroup education ccpmember income urban life pinterest

oprobit disaster diatgov_scaled trustindex_scaled female agegroup education ccpmember income urban life pinterest

oprobit disaster diatgov_scaled  female agegroup education ccpmember income urban life pinterest

oprobit foreignattack  diatgov_scaled trustindex_scaled female agegroup education ccpmember income urban life pinterest

oprobit foreignattack  diatgov_scaled female agegroup education ccpmember income urban life pinterest


**********
clear

exit
